import axios from '@/utils/request'
export const getProList = (paramsObj) => {
  const { categoryId, goodsName } = paramsObj
  return axios.get('/goods/list', {
    params: {
      sortPrice: 0,
      categoryId,
      goodsName,
      page: 1
    }
  })
}
export const getProdetail = (goodsId) => {
  return axios.get('/goods/detail', {
    params: {
      goodsId
    }
  })
}
export const getCommentCount = (goodsId) => {
  return axios.get('/comment/total', {
    params: {
      goodsId
    }
  })
}
export const getCommentList = (goodsId) => {
  return axios.get('/comment/listRows', {
    params: {
      goodsId,
      limit: 5
    }
  })
}

export const addCart = (goodsId, goodsNum, goodsSkuId) => {
  return axios.post('/cart/add', {
    goodsId,
    goodsNum,
    goodsSkuId
  })
}
export const getProTotal = () => {
  return axios.get('/cart/total', {

  })
}
export const getCartList = () => {
  return axios.get('/cart/list', {

  })
}
export const changeCart = (goodsId, goodsNum, goodsSkuId) => {
  return axios.post('/cart/update', {
    goodsId,
    goodsNum,
    goodsSkuId
  })
}
export const deleteCart = (cartIds) => {
  return axios.post('/cart/clear', {
    cartIds
  })
}
